#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

class Solution {
public:
    vector<int> findDisappearedNumbers(vector<int>& nums) {
        vector<int> result;
        int size = nums.size()+1;
        for(int i = 0;i<nums.size();++i){
            //将每一个数对应的索引都加上size；
            int n = nums[i]%size;
            nums[n-1] = nums[n-1]+size;
        }
        for(int i = 0;i<nums.size();++i){
            if(nums[i]<size){
                result.push_back(i+1);
            }
        }
        return result;
    }
};

int main(){
    Solution S;
    vector<int> nums = {4,3,2,7,8,2,3,1};
    vector<int> result = S.findDisappearedNumbers(nums);
    return 0;
}